package god530.com.simpleapp_slide.database;

import android.content.ContentValues;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;

import god530.com.simpleapp_slide.R;

/**
 * Created by Administrator on 2016/12/21.
 */

public class DBTypesUtils {

    public static final String DRESS = "OUT001";
    public static final String FOOD  = "OUT002";
    public static final String SLEEP = "OUT003";
    public static final String WALK  = "OUT004";
    public static final String PLAY  = "OUT005";

    public static void initDetails(Context ctx, SQLiteDatabase db) {
        String tally_outcome_dress  = ctx.getString(R.string.tally_outcome_dress);
        String tally_outcome_food  = ctx.getString(R.string.tally_outcome_food);
        String tally_outcome_sleep  = ctx.getString(R.string.tally_outcome_sleep);
        String tally_outcome_walk  = ctx.getString(R.string.tally_outcome_walk);
        String tally_outcome_play  = ctx.getString(R.string.tally_outcome_play);


        ContentValues valuesDress = new ContentValues();
        valuesDress.put(DBContants.TYPES.SUBS, DBSubsUtils.OUTCOMe);
        valuesDress.put(DBContants.TYPES.NUMBER, DRESS);
        valuesDress.put(DBContants.TYPES.TYPES, tally_outcome_dress);
        db.insert(DBContants.TYPES.TABLE, null, valuesDress);

        ContentValues valuesFood = new ContentValues();
        valuesFood.put(DBContants.TYPES.SUBS, DBSubsUtils.OUTCOMe);
        valuesFood.put(DBContants.TYPES.NUMBER, FOOD);
        valuesFood.put(DBContants.TYPES.TYPES, tally_outcome_food);
        db.insert(DBContants.TYPES.TABLE, null, valuesFood);

        ContentValues valuesSleep = new ContentValues();
        valuesSleep.put(DBContants.TYPES.SUBS, DBSubsUtils.OUTCOMe);
        valuesSleep.put(DBContants.TYPES.NUMBER, SLEEP);
        valuesSleep.put(DBContants.TYPES.TYPES, tally_outcome_sleep);
        db.insert(DBContants.TYPES.TABLE, null, valuesSleep);

        ContentValues valuesWalk = new ContentValues();
        valuesWalk.put(DBContants.TYPES.SUBS, DBSubsUtils.OUTCOMe);
        valuesWalk.put(DBContants.TYPES.NUMBER, WALK);
        valuesWalk.put(DBContants.TYPES.TYPES, tally_outcome_walk);
        db.insert(DBContants.TYPES.TABLE, null, valuesWalk);


        ContentValues valuesPlay = new ContentValues();
        valuesPlay.put(DBContants.TYPES.SUBS, DBSubsUtils.OUTCOMe);
        valuesPlay.put(DBContants.TYPES.NUMBER,  PLAY);
        valuesPlay.put(DBContants.TYPES.TYPES, tally_outcome_play);
        db.insert(DBContants.TYPES.TABLE, null, valuesPlay);
    }

}
